package com.szjz.rabbitmq.springboot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 史博
 * @desc work 模型
 * @date 2020/8/25 6:30 下午 周二
 */
@Slf4j
@Component
public class WorkConsumer {

    /**
     * 消费者01
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    private void receive1(String massage) {
        log.info("=== massage 01 : {}", massage);
    }

    /**
     * 消费者02
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    private void receive2(String massage) {
        log.info("=== massage 02 : {}", massage);
    }
}
